<?php
/**
 * Created by JetBrains PhpStorm.
 * User: akirakozov
 * Date: 1/7/12
 * Time: 2:30 AM
 */
class UserDao
{
	var $conn;

	function UserDao(&$conn) {
		$this->conn =& $conn;
	}

	function login($name, $pass) {
		$sql = 
			"SELECT id FROM user WHERE login='{$name}' AND password='{$pass}'";
		$result = mysql_query($sql, $this->conn) or die (mysql_error());

		return mysql_num_rows($result) > 0;
	}
}

?>